home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / include / libgimp / gimpwidgets.h.z / gimpwidgets.h
Encoding:
C/C++ Source or Header  |  2002-07-08  |  8.4 KB  |  252 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpwidgets.h
  5.  * Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22.  
  23. #ifndef __GIMP_WIDGETS_H__
  24. #define __GIMP_WIDGETS_H__
  25.  
  26. #include <libgimp/gimpsizeentry.h>
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif /* __cplusplus */
  31.  
  32. /* For information look into the C source or the html documentation */
  33.  
  34. /*
  35.  *  Widget Constructors
  36.  */
  37.  
  38. GtkWidget * gimp_option_menu_new   (gboolean            menu_only,
  39.  
  40.                     /* specify menu items as va_list:
  41.                      *  gchar          *label,
  42.                      *  GtkSignalFunc   callback,
  43.                      *  gpointer        data,
  44.                      *  gpointer        user_data,
  45.                      *  GtkWidget     **widget_ptr,
  46.                      *  gboolean        active
  47.                      */
  48.  
  49.                     ...);
  50.  
  51. GtkWidget * gimp_option_menu_new2  (gboolean            menu_only,
  52.                     GtkSignalFunc       menu_item_callback,
  53.                     gpointer            data,
  54.                     gpointer            initial, /* user_data */
  55.  
  56.                     /* specify menu items as va_list:
  57.                      *  gchar          *label,
  58.                      *  gpointer        user_data,
  59.                      *  GtkWidget     **widget_ptr,
  60.                      */
  61.  
  62.                     ...);
  63.  
  64. void  gimp_option_menu_set_history (GtkOptionMenu      *option_menu,
  65.                     gpointer            user_data);
  66.  
  67. GtkWidget * gimp_radio_group_new   (gboolean            in_frame,
  68.                     const gchar        *frame_title,
  69.  
  70.                     /* specify radio buttons as va_list:
  71.                      *  const gchar    *label,
  72.                      *  GtkSignalFunc   callback,
  73.                      *  gpointer        data,
  74.                      *  gpointer        user_data,
  75.                      *  GtkWidget     **widget_ptr,
  76.                      *  gboolean        active,
  77.                      */
  78.  
  79.                     ...);
  80.  
  81. GtkWidget * gimp_radio_group_new2  (gboolean            in_frame,
  82.                     const gchar        *frame_title,
  83.                     GtkSignalFunc       radio_button_callback,
  84.                     gpointer            data,
  85.                     gpointer            initial, /* user_data */
  86.  
  87.                     /* specify radio buttons as va_list:
  88.                      *  const gchar    *label,
  89.                      *  gpointer        user_data,
  90.                      *  GtkWidget     **widget_ptr,
  91.                      */
  92.  
  93.                     ...);
  94.  
  95. GtkWidget * gimp_spin_button_new   (/* return value: */
  96.                     GtkObject         **adjustment,
  97.  
  98.                     gfloat              value,
  99.                     gfloat              lower,
  100.                     gfloat              upper,
  101.                     gfloat              step_increment,
  102.                     gfloat              page_increment,
  103.                     gfloat              page_size,
  104.                     gfloat              climb_rate,
  105.                     guint               digits);
  106.  
  107. #define GIMP_SCALE_ENTRY_LABEL(adj) \
  108.         GTK_LABEL (gtk_object_get_data (GTK_OBJECT(adj), "label"))
  109.  
  110. #define GIMP_SCALE_ENTRY_SCALE(adj) \
  111.         GTK_HSCALE (gtk_object_get_data (GTK_OBJECT(adj), "scale"))
  112. #define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
  113.         gtk_range_get_adjustment \
  114.         (GTK_RANGE (gtk_object_get_data (GTK_OBJECT (adj), "scale")))
  115.  
  116. #define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
  117.         GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton"))
  118. #define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
  119.         gtk_spin_button_get_adjustment \
  120.         (GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (adj), "spinbutton")))
  121.  
  122. GtkObject * gimp_scale_entry_new   (GtkTable           *table,
  123.                     gint                column,
  124.                     gint                row,
  125.                     const gchar        *text,
  126.                     gint                scale_usize,
  127.                     gint                spinbutton_usize,
  128.                     gfloat              value,
  129.                     gfloat              lower,
  130.                     gfloat              upper,
  131.                     gfloat              step_increment,
  132.                     gfloat              page_increment,
  133.                     guint               digits,
  134.                     gboolean            constrain,
  135.                     gfloat              unconstrained_lower,
  136.                     gfloat              unconstrained_upper,
  137.                     const gchar        *tooltip,
  138.                     const gchar        *help_data);
  139.  
  140. #define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
  141.         GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT( hbox), "spinbutton"))
  142. #define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
  143.         gtk_spin_button_get_adjustment \
  144.         (GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), "spinbutton")))
  145.  
  146. #define GIMP_RANDOM_SEED_TOGGLEBUTTON(hbox) \
  147.         GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (hbox), \
  148.                                                 "togglebutton"))
  149.  
  150. GtkWidget * gimp_random_seed_new   (gint               *seed,
  151.                     gint               *use_time,
  152.                     gint                time_true,
  153.                     gint                time_false);
  154.  
  155. #define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
  156.         GIMP_CHAIN_BUTTON (gtk_object_get_data (GTK_OBJECT (sizeentry), \
  157.                                                 "chainbutton"))
  158.  
  159. GtkWidget * gimp_coordinates_new   (GimpUnit            unit,
  160.                     const gchar        *unit_format,
  161.                     gboolean            menu_show_pixels,
  162.                     gboolean            menu_show_percent,
  163.                     gint                spinbutton_usize,
  164.                     GimpSizeEntryUpdatePolicy  update_policy,
  165.  
  166.                     gboolean            chainbutton_active,
  167.                     gboolean            chain_constrains_ratio,
  168.  
  169.                     const gchar        *xlabel,
  170.                     gdouble             x,
  171.                     gdouble             xres,
  172.                     gdouble             lower_boundary_x,
  173.                     gdouble             upper_boundary_x,
  174.                     gdouble             xsize_0,   /* % */
  175.                     gdouble             xsize_100, /* % */
  176.  
  177.                     const gchar        *ylabel,
  178.                     gdouble             y,
  179.                     gdouble             yres,
  180.                     gdouble             lower_boundary_y,
  181.                     gdouble             upper_boundary_y,
  182.                     gdouble             ysize_0,   /* % */
  183.                     gdouble             ysize_100  /* % */);
  184.  
  185. #define GIMP_MEM_SIZE_ENTRY_SPINBUTTON(memsize) \
  186.         GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (memsize), \
  187.                                               "spinbutton"))
  188. #define GIMP_MEM_SIZE_ENTRY_SPINBUTTON_ADJ(memsize) \
  189.         gtk_spin_button_get_adjustment \
  190.         (GTK_SPIN_BUTTON (gtk_object_get_data (GTK_OBJECT (memsize), \
  191.                                                "spinbutton")))
  192. #define GIMP_MEM_SIZE_ENTRY_OPTIONMENU(memsize) \
  193.         GTK_OPTION_MENU (gtk_object_get_data (GTK_OBJECT (memsize), \
  194.                                               "optionmenu"))
  195.  
  196. GtkWidget * gimp_mem_size_entry_new (GtkAdjustment      *adjustment);
  197.   
  198.  
  199. GtkWidget * gimp_pixmap_button_new  (gchar             **xpm_data,
  200.                      const gchar        *text);
  201.  
  202. /*
  203.  *  Standard Callbacks
  204.  */
  205.  
  206. void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);
  207.  
  208. void gimp_toggle_button_update           (GtkWidget       *widget,
  209.                       gpointer         data);
  210.  
  211. void gimp_radio_button_update            (GtkWidget       *widget,
  212.                       gpointer         data);
  213.  
  214. void gimp_menu_item_update               (GtkWidget       *widget,
  215.                       gpointer         data);
  216.  
  217. void gimp_int_adjustment_update          (GtkAdjustment   *adjustment,
  218.                       gpointer         data);
  219.  
  220. void gimp_uint_adjustment_update         (GtkAdjustment   *adjustment,
  221.                       gpointer         data);
  222.  
  223. void gimp_float_adjustment_update        (GtkAdjustment   *adjustment,
  224.                       gpointer         data);
  225.  
  226. void gimp_double_adjustment_update       (GtkAdjustment   *adjustment,
  227.                       gpointer         data);
  228.  
  229. void gimp_unit_menu_update               (GtkWidget       *widget,
  230.                       gpointer         data);
  231.  
  232. /*
  233.  *  Helper Functions
  234.  */
  235.  
  236. void gimp_table_attach_aligned     (GtkTable           *table,
  237.                     gint                column,
  238.                     gint                row,
  239.                     const gchar        *label_text,
  240.                     gfloat              xalign,
  241.                     gfloat              yalign,
  242.                     GtkWidget          *widget,
  243.                     gint                colspan,
  244.                     gboolean            left_align);
  245.  
  246.  
  247. #ifdef __cplusplus
  248. }
  249. #endif /* __cplusplus */
  250.  
  251. #endif /* __GIMP_WIDGETS_H__ */
  252.